home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2000 September / september_2000.iso / intercd / root / ^Linux / WindowMaker / configure.in < prev    next >
Encoding:
Text File  |  2000-04-02  |  25.3 KB  |  1,067 lines

  1. dnl
  2. dnl Window Maker autoconf input.
  3. dnl
  4. dnl Process with:
  5. dnl               aclocal
  6. dnl               autoheader
  7. dnl               autoconf
  8. dnl               libtoolize --force --automake
  9. dnl               automake -a --gnu --include-deps
  10. dnl
  11. dnl
  12.  
  13.  
  14. AC_INIT(src/WindowMaker.h)
  15.  
  16.  
  17.  
  18. AM_INIT_AUTOMAKE(WindowMaker, 0.62.1)
  19.  
  20. AM_PROG_LIBTOOL
  21.  
  22. # by Marcelo Magallon <mmagallo@efis.ucr.ac.cr>
  23. # Turn around -rpath problem with libtool 1.0c
  24. # This define should be improbable enough to not conflict with anything
  25. case ${host} in
  26.   *-pc-linux-gnu)
  27.     AC_MSG_RESULT([Fixing libtool for -rpath problems.])
  28.     sed < libtool > libtool-2 \
  29.     's/^hardcode_libdir_flag_spec.*$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/'
  30.     mv libtool-2 libtool
  31.     chmod 755 libtool
  32.   ;;
  33. esac
  34.  
  35.  
  36. AM_CONFIG_HEADER(src/config.h)
  37.  
  38.  
  39. dnl Checks for host/os name
  40. dnl =======================
  41. AC_CANONICAL_HOST
  42.  
  43.  
  44. dnl Checks for programs.
  45. dnl ===================
  46. AC_ISC_POSIX
  47. AC_PROG_CC
  48. dnl AC_PROG_MAKE_SET -- already done by AM_INIT_AUTOMAKE
  49. #AC_PROG_RANLIB
  50. dnl AC_PROG_INSTALL -- already done by AM_INIT_AUTOMAKE
  51. AC_PROG_LN_S
  52. AC_PROG_GCC_TRADITIONAL
  53.  
  54.  
  55. dnl the prefix
  56. dnl ==========
  57. dnl
  58. dnl move this earlier in the script... anyone know why this is handled
  59. dnl in such a bizarre way?
  60.  
  61. test "x$prefix" = xNONE && prefix=$ac_default_prefix
  62. dnl Let make expand exec_prefix.
  63. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
  64.  
  65.  
  66. _bindir=`eval echo $bindir`
  67. _bindir=`eval echo $_bindir`
  68.  
  69. _libdir=`eval echo $libdir`
  70. _libdir=`eval echo $_libdir`
  71. lib_search_path="-L$_libdir"
  72.  
  73. inc_search_path=`eval echo $includedir`
  74. inc_search_path="-I`eval echo $inc_search_path`"
  75.  
  76.  
  77. dnl
  78. dnl Check for RedHat bugs
  79. dnl =====================
  80.  
  81. dnl WM_CHECK_REDCRAP_BUGS($prefix,$_bindir,$_libdir)
  82.  
  83.  
  84. dnl
  85. dnl Specify paths to look for libraries and headers
  86. dnl ===============================================
  87. AC_ARG_WITH(libs-from,
  88. [  --with-libs-from      pass compiler flags to look for libraries],
  89.     [lib_search_path="$withval $lib_search_path"])
  90.  
  91. AC_ARG_WITH(incs-from,
  92. [  --with-incs-from      pass compiler flags to look for header files],
  93.     [inc_search_path="$withval $inc_search_path"])
  94.  
  95.  
  96.  
  97. dnl Checks for library functions.
  98. dnl ============================
  99. dnl not used anywhere
  100. dnl AC_FUNC_MEMCMP  
  101. AC_FUNC_VPRINTF
  102. AC_FUNC_ALLOCA
  103. AC_CHECK_FUNCS(gethostname select poll strerror strncasecmp setpgid atexit)
  104.  
  105.  
  106.  
  107. dnl Loading of dynamic libraries at runtime
  108. dnl =======================================
  109. DLLIBS=""
  110.  
  111. AC_CHECK_FUNC(dlopen, [HAVEDL="yes"], 
  112.     AC_CHECK_LIB(dl, dlopen, [DLLIBS="-ldl" HAVEDL="yes"],
  113.              DLLIBS="" ))
  114.  
  115. if test "x$HAVEDL" = xyes; then
  116.     AC_CHECK_HEADERS(dlfcn.h)
  117. fi
  118.  
  119.  
  120.  
  121. dnl Check CPP
  122. dnl =========
  123. if test "x$CPP_PATH" = x; then
  124.     AC_PATH_PROG(CPP_PATH, cpp, notfound, 
  125.         $PATH:/lib:/usr/bin:/bin:/usr/lib:/usr/ccs/lib)
  126. fi
  127.  
  128. dnl
  129. dnl Tell stupid Solaris cpp that the files it will process have C++ like syntax
  130. dnl RedHat 5.x is broken too, so it won't make a symlink from cpp to the
  131. dnl standard locations
  132. dnl
  133. if test "$CPP_PATH" = "/usr/ccs/lib/cpp" -o "$CPP_PATH" = "notfound" ; then
  134.     if test "$GCC" = "yes"; then
  135.     CPP_PATH="gcc -E -x c"
  136.     else 
  137.     if test "$CPP_PATH" = "/usr/ccs/lib/cpp"; then
  138.         CPP_PATH="$CPP_PATH -B"
  139.     else
  140.         echo "cpp, the C preprocessor was not found in your system."
  141.           echo "Create a symbolic link from it to /lib/cpp and rerun configure"
  142.           exit
  143.     fi
  144.     fi
  145. fi
  146. AC_DEFINE_UNQUOTED(CPP_PATH, "$CPP_PATH")
  147.  
  148.  
  149.  
  150. dnl Checks for header files.
  151. dnl =======================
  152. dnl AC_HEADER_STDC
  153. AC_HEADER_SYS_WAIT
  154. AC_HEADER_TIME
  155. AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h\
  156.         libintl.h sys/select.h poll.h)
  157.  
  158.  
  159.  
  160. dnl Checks for typedefs, structures, and compiler characteristics.
  161. dnl ==============================================================
  162. AC_DECL_SYS_SIGLIST
  163. AC_C_CONST
  164. #AC_TYPE_SIZE_T
  165. #AC_TYPE_PID_T
  166. AC_TYPE_SIGNAL
  167.  
  168.     
  169.  
  170. dnl Compiler/architecture specific optimizations
  171. dnl ============================================
  172.     
  173.  
  174. dnl GCC/as with MMX support
  175. dnl --------------------
  176.  
  177. if test "$ac_cv_prog_gcc" = yes; then
  178.     x86=0
  179.     changequote(,)dnl
  180.     case "$host_cpu" in
  181.     i[3456]86) x86=1
  182.     ;;
  183.     esac
  184.     changequote([,])dnl
  185.  
  186.     if test $x86 = 1; then
  187.         AC_DEFINE(ASM_X86)
  188.  
  189.     AC_CACHE_CHECK(whether gcc supports MMX(tm) inline asm,
  190.                ac_cv_c_inline_mmx,
  191.                [AC_TRY_LINK(,[asm ("movq %mm0, %mm1");],
  192.                ac_cv_c_inline_mmx=yes,
  193.                ac_cv_c_inline_mmx=no)])
  194.  
  195.     if test "x$ac_cv_c_inline_mmx" = xyes; then
  196.         AC_DEFINE(ASM_X86_MMX)
  197.     fi
  198.     fi
  199. fi
  200.  
  201.  
  202.  
  203. dnl gettext
  204. dnl =======
  205.  
  206.  
  207. dnl AM_GNU_GETTEXT
  208.  
  209.  
  210.  
  211. INTLIBS=""
  212.  
  213. AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"], 
  214.     AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
  215.              INTLIBS="" ))
  216.  
  217. AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
  218.  
  219. if test "$XGETTEXT" != ""; then 
  220.     if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
  221.         echo "xgettext isn't GNU version"
  222.         XGETTEXT=""
  223.     fi
  224. fi
  225.  
  226. if test "$LINGUAS" != ""; then
  227.     if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
  228.         AC_DEFINE(I18N)
  229.         PO=""
  230. #       if test "$LINGUAS" = ""; then
  231. #           ling=` (cd src/po; /bin/ls *.po) `
  232. #            for l in $ling; do
  233. #            lcode=`basename $l .po`
  234. #            LINGUAS="$LINGUAS $lcode"
  235. #           done
  236. #       fi
  237.         echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
  238.     else
  239.         LINGUAS=""
  240.         PO=""
  241.         echo "xgettext and libintl.a don't both exist; will not build i18n support"
  242.     fi
  243. else
  244.         INTLIBS=""
  245.     MOFILES=""
  246.     WPMOFILES=""
  247.     PO=""
  248. fi
  249.  
  250.  
  251. dnl The Tower of Babel
  252. dnl ==================
  253.  
  254. dnl List of supported locales
  255. dnl -------------------------
  256. supported_locales="cs de es fr gl it ja ko nl no pt ru se tr fi hr el pl ro da zh_TW.Big5 zh_CN sk"
  257. supported_wprefs_locales="pt hr fr ko ja cs zh_TW.Big5 es zh_CN fi it ru de"
  258.  
  259. for lang in $LINGUAS; do
  260.     ok=0
  261.     for l in $supported_locales; do
  262.         if test "$l" = "$lang"; then
  263.             ok=1
  264.             break
  265.         fi
  266.     done
  267.     if test "$ok" = 1; then
  268.         MOFILES="$MOFILES $lang.mo"
  269.     else
  270.         echo "Locale $lang is not supported."
  271.     fi
  272.     ok=0
  273.     for l in $supported_wprefs_locales; do
  274.         if test "$l" = "$lang"; then
  275.             ok=1
  276.             break
  277.         fi
  278.     done
  279.     if test "$ok" = 1; then
  280.         WPMOFILES="$WPMOFILES $lang.mo"
  281.     fi
  282. done
  283.  
  284.  
  285. dnl Kanji Characters support
  286. dnl ========================
  287.  
  288. case $host_os in
  289.     freebsd*)
  290.         AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"]);;
  291.     *)
  292.     ;;
  293. esac
  294.  
  295.  
  296.  
  297. dnl Added by Oliver - Support for NLSDIR option,   Hi Oliver!
  298. dnl ===========================================
  299. AC_ARG_WITH(nlsdir, 
  300.     [  --with-nlsdir=PATH      specify where the locale stuff should go ])
  301.  
  302.  
  303. if test "x$NLSDIR" = "x"; then
  304.     if test "x$with_nlsdir" != "x"; then
  305.         NLSDIR=$with_nlsdir
  306.     else
  307.         NLSDIR='$(prefix)/lib/locale'
  308.     fi
  309. fi
  310.  
  311.  
  312.  
  313. AC_SUBST(DLLIBS)
  314. AC_SUBST(INTLIBS)
  315. AC_SUBST(NLSDIR)
  316. AC_SUBST(MOFILES)
  317. AC_SUBST(WPMOFILES)
  318. AC_SUBST(supported_locales)
  319.  
  320.  
  321.  
  322. dnl Support for various hint things
  323. dnl ===============================
  324.  
  325.  
  326. AC_ARG_ENABLE(gnome,
  327.   [  --enable-gnome      enable stuff needed for GNOME ],
  328.   [if test x$enableval = xyes; then
  329.     AC_DEFINE(GNOME_STUFF)
  330.     gnome_on=yes
  331.   fi])
  332.  
  333.  
  334. AC_ARG_ENABLE(kde,
  335.   [  --enable-kde          enable support for KDE window manager (kwm) hints ],
  336.   [if test x$enableval = xyes; then
  337.     AC_DEFINE(KWM_HINTS)
  338.     kde_on=yes
  339.   fi])
  340.  
  341.  
  342. AC_ARG_ENABLE(openlook,
  343.   [  --enable-openlook      enable support for OPEN LOOK(tm) (olwm) hints ],
  344.   [if test x$enableval = xyes; then
  345.     AC_DEFINE(OLWM_HINTS)
  346.     openlook_on=yes
  347.   fi])
  348.  
  349.  
  350. dnl
  351. dnl Disable some stuff that are duplicated in kde
  352. dnl ---------------------------------------------
  353. AC_ARG_ENABLE(lite,
  354.   [  --enable-lite          disable some stuff (dont use it) ],
  355.   [if test x$enableval = xyes; then
  356.         LITE=yes
  357.     AC_DEFINE(LITE)
  358.         AC_SUBST(LITE)
  359.   fi])
  360.  
  361.  
  362.  
  363. dnl
  364. dnl Networking stuff
  365. dnl
  366.  
  367. NETLIBS=""
  368.  
  369. AC_CHECK_FUNC(connect,,
  370.     AC_CHECK_LIB(socket, connect, NETLIBS="$NETLIBS -lsocket"))
  371.  
  372. AC_CHECK_FUNC(gethostbyname,,
  373.     AC_CHECK_LIB(nsl, gethostbyname, NETLIBS="$NETLIBS -lnsl"))
  374.  
  375. AC_CHECK_FUNC(inet_aton, AC_DEFINE(HAVE_INET_ATON),
  376.      for lib in resolv socket inet bsd; do
  377.     AC_CHECK_LIB($lib, inet_aton, [AC_DEFINE(HAVE_INET_ATON)
  378.                  NETLIBS="$NETLIBS -l$lib"; break],, $NETLIBS)
  379.      done)
  380.  
  381. AC_SUBST(NETLIBS)
  382.  
  383.  
  384. dnl ===========================================
  385. dnl         Stuff that uses X
  386. dnl ===========================================
  387.  
  388. AC_PATH_XTRA
  389.  
  390. if test $no_x; then
  391.     AC_MSG_ERROR([The path for the X11 files not found!
  392. Make sure you have X and it's headers and libraries (the -devel packages
  393. in Linux) installed.])
  394. fi
  395.  
  396. X_LIBRARY_PATH=$x_libraries
  397.  
  398. XCFLAGS="$X_CFLAGS"
  399.  
  400. XLFLAGS="$X_LIBS"
  401.  
  402. XLIBS="-lX11 $X_EXTRA_LIBS"
  403.  
  404.  
  405. lib_search_path="$lib_search_path $XLFLAGS"
  406. inc_search_path="$inc_search_path $XCFLAGS"
  407.  
  408.  
  409. AC_SUBST(X_LIBRARY_PATH)
  410.  
  411.  
  412.  
  413. dnl Decide which locale function to use, setlocale() or _Xsetlocale()
  414. dnl by MANOME Tomonori 
  415. dnl ===========================================
  416. use_locale=yes
  417. AC_ARG_ENABLE(locale, 
  418. [  --disable-locale      disable use of X locale support],
  419.         use_locale=no)
  420.  
  421. if test "$use_locale" = yes; then
  422.   AC_CHECK_LIB(X11, _Xsetlocale, AC_DEFINE(X_LOCALE),, $XLFLAGS $XLIBS)
  423. fi
  424.  
  425.  
  426. dnl Check whether XInternAtoms() exist
  427. dnl ==================================
  428. AC_CHECK_LIB(X11, XInternAtoms, AC_DEFINE(HAVE_XINTERNATOMS),,$XLFLAGS $XLIBS)
  429.  
  430.  
  431. dnl XKB keyboard language status
  432. dnl ============================
  433. AC_ARG_ENABLE(modelock,
  434. [  --enable-modelock      XKB keyboard language status support],
  435.         AC_DEFINE(XKB_MODELOCK))
  436.  
  437.  
  438.  
  439. dnl Shape support
  440. dnl =============
  441. shape=yes
  442. AC_ARG_ENABLE(shape, 
  443. [  --disable-shape      disable shaped window extension support],
  444.         shape=$enableval, shape=yes)
  445.  
  446. added_xext=no
  447.  
  448. if test "$shape" = yes; then
  449.     AC_CHECK_LIB(Xext, XShapeSelectInput, [XLIBS="-lXext $XLIBS"
  450.         added_xext=yes
  451.                 AC_DEFINE(SHAPE)], shape=no, $XLFLAGS $XLIBS)
  452. fi
  453.  
  454.  
  455. dnl XINERAMA support
  456. dnl ================
  457. xinerama=yes
  458. AC_ARG_ENABLE(xinerama, 
  459. [  --disable-xinerama      disable XInerama extension support],
  460.         xinerama=$enableval, xinerama=yes)
  461.  
  462. if test "$xinerama" = yes; then
  463.     AC_CHECK_LIB(Xext, X, [XLIBS="-lXext $XLIBS"
  464.         added_xext=yes
  465.                 AC_DEFINE(XINERAMA)], xinerama=no, $XLFLAGS $XLIBS)
  466. fi
  467.  
  468.  
  469.  
  470. dnl MIT-SHM support
  471. dnl ===============
  472. shm=yes
  473. AC_ARG_ENABLE(shm,
  474. [  --disable-shm           disable usage of MIT-SHM extension],
  475.         shm=$enableval, shm=yes)
  476.  
  477. if test "$shm" = yes; then
  478.     AC_CHECK_LIB(Xext, XShmAttach, ok=yes, ok=no, $XLFLAGS $XLIBS)
  479.  
  480.     if test "$ok" = yes; then
  481.     AC_CHECK_FUNC(shmget, ok=yes, ok=no)
  482.     fi
  483.  
  484.     if test "$ok" = yes; then
  485.         if test "$added_xext" = no; then
  486.             XLIBS="-lXext $XLIBS"
  487.         fi
  488.                 AC_DEFINE(XSHM)
  489.     fi
  490. fi
  491.  
  492.  
  493. dnl R6 Style Session Management Support
  494. dnl ===================================
  495.  
  496. #
  497. #
  498. #AC_DEFINE(R6SM)
  499. #AC_SUBST(XSMPLIBS)
  500. #
  501.  
  502.  
  503. dnl Check for libPropList
  504. dnl =====================
  505.  
  506. LIBPL=""
  507.  
  508. WM_CHECK_LIB(PropList, PLGetString, $X_EXTRA_LIBS)
  509. if test "x$ac_cv_lib_PropList_PLGetString" = xyes; then
  510.     WM_CHECK_HEADER(proplist.h)
  511.     if test "x$ac_cv_header_proplist_h" = xyes; then
  512.         LIBPL="-lPropList"
  513.     fi
  514. fi
  515.  
  516. if test "x$LIBPL" = "x"; then
  517.    echo
  518.    echo "ERROR!!! libPropList is not installed, or could not be found."
  519.    echo "         Window Maker requires libPropList to build."
  520.    echo "         Please read INSTALL to find where you can find libPropList,"
  521.    echo "         and install it first."
  522.    if test x$host_os = xlinux; then
  523.    echo "         If you're using some prepackaged version of libPropList,"
  524.    echo "         make sure you install it's \"development\" package as well."
  525.    fi
  526.    echo "         If you already have it installed, try using the"
  527.    if test "x$ac_cv_lib_PropList_PLGetString" != xyes; then
  528.    echo "         --with-libs-from flag to tell configure where the library"
  529.    echo "      is installed and"
  530.    fi
  531.    echo "         --with-incs-from flag to tell configure where the header"
  532.    echo "      files are installed"
  533.    exit 1
  534. fi
  535.  
  536. lPLVersion="0.10.1"
  537.  
  538. WM_CHECK_PROPLIST_VERSION($lPLVersion, goodlPL=yes, goodlPL=no)
  539.  
  540. if test "$goodlPL" = no; then
  541.    echo
  542.    echo "ERROR!!! libPropList is an old version. Please consider upgrading"
  543.    echo "         to at least version ${lPLVersion}. Older versions have bugs that"
  544.    echo "         may cause Window Maker to crash randomly."
  545.    echo "         If your libPropList is older than 0.9.2 it will also prevent"
  546.    echo "         Window Maker from compiling because new functions were"
  547.    echo "         introduced since that version."
  548.    echo "         Please read INSTALL to find where you can find libPropList,"
  549.    echo "         and upgrade it before you proceed."
  550.    exit 1
  551. fi
  552.  
  553. AC_SUBST(LIBPL)
  554.  
  555.  
  556. dnl ==============================================
  557. dnl         Graphic Format Libraries
  558. dnl ==============================================
  559.  
  560.  
  561.  
  562.  
  563.  
  564. dnl XPM Support
  565. dnl ===========
  566. xpm=yes
  567. AC_ARG_ENABLE(xpm, 
  568. [  --disable-xpm            disable use of XPM pixmaps through libXpm],
  569.     xpm=$enableval, xpm=yes)
  570.  
  571. if test "$xpm" = yes; then
  572.     WM_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [$XLFLAGS $XLIBS])
  573.  
  574.     if test "x$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = xyes; then
  575.         WM_CHECK_HEADER(X11/xpm.h)
  576.     if test "x$ac_cv_header_X11_xpm_h" = xyes; then
  577.         GFXLIBS="$GFXLIBS -lXpm"
  578.         supported_gfx="XPM"
  579.         AC_DEFINE(USE_XPM)
  580.     else
  581.         supported_gfx="builtin-XPM"
  582.     fi
  583.     fi
  584. fi
  585.  
  586. # for wmlib
  587. AC_SUBST(XCFLAGS)
  588. # for test
  589. AC_SUBST(XLFLAGS)
  590. AC_SUBST(XLIBS)
  591.  
  592. AC_SUBST(X_EXTRA_LIBS)
  593.  
  594. dnl ===============================================
  595. dnl         End of stuff that uses X
  596. dnl ===============================================
  597.  
  598.  
  599. dnl PNG Support
  600. dnl ===========
  601. png=yes
  602. AC_ARG_ENABLE(png, 
  603. [  --disable-png            disable PNG support through libpng],
  604.     png=$enableval, png=yes, png=no)
  605.  
  606.  
  607. if test "$png" = yes ; then
  608.     WM_CHECK_LIB(png, png_get_valid, [-lz -lm])
  609.  
  610.     if test "x$ac_cv_lib_png_png_get_valid" = xyes; then
  611.         WM_CHECK_HEADER(png.h)
  612.     if test "x$ac_cv_header_png_h" = xyes; then
  613.         GFXLIBS="$GFXLIBS -lpng -lz" 
  614.         supported_gfx="$supported_gfx PNG"
  615.             AC_DEFINE(USE_PNG)
  616.     fi
  617.     fi
  618. fi
  619.  
  620.  
  621. dnl JPEG Support
  622. dnl ============
  623. jpeg=yes
  624. ljpeg=""
  625. AC_ARG_ENABLE(jpeg,
  626. [  --disable-jpeg      disable JPEG support through libjpeg],
  627.     jpeg=$enableval, jpeg=yes, jpeg=no)
  628.  
  629. if test "$jpeg" = yes; then
  630.     WM_CHECK_LIB(jpeg, jpeg_destroy_compress)
  631.  
  632.     if test "x$ac_cv_lib_jpeg_jpeg_destroy_compress" = xyes; then
  633.  
  634.         ljpeg="-ljpeg"
  635.  
  636.     WM_CHECK_HEADER(jpeglib.h)
  637.     if test "x$ac_cv_header_jpeglib_h" = xyes; then
  638.         GFXLIBS="$GFXLIBS -ljpeg"
  639.         supported_gfx="$supported_gfx JPEG"
  640.             AC_DEFINE(USE_JPEG)
  641.     fi
  642.     fi
  643. fi
  644.  
  645.  
  646. dnl GIF Support
  647. dnl ============
  648. gif=yes
  649. AC_ARG_ENABLE(gif,
  650. [  --disable-gif           disable GIF support through libgif or libungif],
  651.     gif=$enableval, gif=yes, gif=no)
  652.  
  653. if test "$gif" = yes; then
  654.     my_libname=""
  655.     WM_CHECK_LIB(ungif, DGifOpenFileName, [$XLFLAGS $XLIBS])
  656.     if test "x$ac_cv_lib_ungif_DGifOpenFileName" = xyes; then
  657.         my_libname=-lungif
  658.     fi
  659. dnl
  660. dnl libungif is the same thing as libgif for all practical purposes.
  661. dnl
  662.     if test "x$my_libname" = x; then
  663.         WM_CHECK_LIB(gif, DGifOpenFileName, [$XLFLAGS $XLIBS])
  664.         if test "x$ac_cv_lib_gif_DGifOpenFileName" = xyes; then
  665.             my_libname=-lgif
  666.         fi
  667.     fi
  668.  
  669.     if test "$my_libname" != x; then
  670.     WM_CHECK_HEADER(gif_lib.h)
  671.     if test "x$ac_cv_header_gif_lib_h" = xyes; then
  672.         GFXLIBS="$GFXLIBS $my_libname"
  673.         supported_gfx="$supported_gfx GIF"
  674.             AC_DEFINE(USE_GIF)
  675.     fi
  676.     fi
  677. fi
  678.  
  679.  
  680.  
  681. dnl TIFF Support
  682. dnl ============
  683. AC_ARG_ENABLE(tiff, 
  684. [  --disable-tiff      disable use of TIFF images through libtiff],
  685.     tif=$enableval, tif=yes, tif=no)
  686.  
  687. #
  688. # TIFF can optionally have JPEG and/or zlib support. Must find out
  689. # when they are supported so that correct library flags are passed during
  690. # detection and linkage
  691. #
  692. #
  693. # By default use xpm icons if tiff is not found.
  694. ICONEXT="xpm"
  695. #
  696.  
  697. if test "$tif" = yes; then
  698.     my_libname=""
  699.     WM_CHECK_LIB(tiff, TIFFGetVersion, [-lm])
  700.     if test "x$ac_cv_lib_tiff_TIFFGetVersion" = xyes; then
  701.         my_libname="-ltiff"
  702.     fi
  703. dnl
  704. dnl Retry with zlib
  705. dnl
  706.     unset ac_cv_lib_tiff_TIFFGetVersion
  707.     if test "x$my_libname" = x; then
  708.         WM_CHECK_LIB(tiff, TIFFGetVersion, [$ljpeg -lz -lm])
  709.     if test "x$ac_cv_lib_tiff_TIFFGetVersion" = xyes; then
  710.         my_libname="-ltiff -lz"
  711.     fi
  712.     fi
  713.  
  714.     if test "x$my_libname" = x; then
  715.     WM_CHECK_LIB(tiff34, TIFFGetVersion, [$ljpeg -lm])
  716.     if test "x$ac_cv_lib_tiff34_TIFFGetVersion" = xyes; then
  717.         my_libname="-ltiff34"
  718.     fi
  719.     fi
  720.  
  721.  
  722.     if test "x$my_libname" != x; then
  723.     WM_CHECK_HEADER(tiffio.h)
  724.     if test "x$ac_cv_header_tiffio_h" = xyes; then
  725.         GFXLIBS="$my_libname $GFXLIBS"
  726.         ICONEXT="tiff"
  727.             supported_gfx="$supported_gfx TIFF"
  728.             AC_DEFINE(USE_TIFF)        
  729.     fi
  730.     fi
  731. fi
  732.  
  733. LIBRARY_SEARCH_PATH="$lib_search_path"
  734. HEADER_SEARCH_PATH="$inc_search_path"
  735.  
  736. AC_SUBST(LIBRARY_SEARCH_PATH)
  737. AC_SUBST(HEADER_SEARCH_PATH)
  738.  
  739.  
  740. AC_SUBST(GFXLIBS)
  741. AC_SUBST(ICONEXT)
  742.  
  743.  
  744. dnl ==============================================
  745. dnl         End of Graphic Format Libraries
  746. dnl ==============================================
  747.  
  748.  
  749. dnl Debugging setup
  750. dnl ===============
  751. AC_ARG_ENABLE(debug, 
  752. [  --enable-debug      enable debugging ],, enable_debug=no)
  753.  
  754. if test "$enable_debug" = yes; then
  755.     DFLAGS="-g -DDEBUG"
  756. #    Efence makes things too slow. Add it by hand in the Makefiles
  757. #    if it is really needed.
  758. #    AC_CHECK_LIB(efence, malloc, LIBS="$LIBS -lefence")
  759. else
  760.     DFLAGS="-DWITHOUT_NANA"
  761. fi
  762. AC_SUBST(DFLAGS)
  763.  
  764.  
  765. dnl Sound support - Dan
  766. dnl =============================================
  767. sound=yes
  768. AC_ARG_ENABLE(sound, 
  769. [  --disable-sound      disable sound support ],
  770.         sound=$enableval, sound=yes)
  771. if test "$sound" = yes; then    
  772.         AC_DEFINE(WMSOUND)
  773. fi
  774.  
  775.  
  776. # AC_PREFIX_PROGRAM(wmaker)
  777.  
  778. dnl Support for PIXMAPDIR option
  779. dnl ============================
  780. AC_ARG_WITH(pixmapdir,
  781. [  --with-pixmapdir=PATH   specify where pixmaps are located [DATADIR/pixmaps]])
  782.  
  783. if test "x$with_pixmapdir" != "x"; then
  784.     pixmapdir=$with_pixmapdir
  785. else
  786.     pixmapdir=`eval echo ${datadir}/pixmaps`
  787. fi
  788.  
  789. AC_DEFINE_UNQUOTED(PIXMAPDIR, "$pixmapdir")
  790.  
  791. pkgdatadir=`eval echo $datadir`
  792. AC_DEFINE_UNQUOTED(PKGDATADIR, "$pkgdatadir/WindowMaker")
  793.  
  794. _sysconfdir=`eval echo $sysconfdir`
  795. AC_DEFINE_UNQUOTED(SYSCONFDIR, "$_sysconfdir")
  796.  
  797.  
  798. dnl Support for GNUSTEP_LOCAL_ROOT, for WPrefs.app
  799. dnl ==============================================
  800.  
  801. appspath=""
  802.  
  803. AC_ARG_WITH(appspath,
  804. [  --with-appspath=PATH    specify the directory for GNUstep applications], appspath=$withval )
  805.  
  806. if test "x$appspath" = "x"; then
  807.     gnustepdir='$(prefix)/GNUstep'
  808.  
  809.     if test "x$GNUSTEP_LOCAL_ROOT" != "x" ; then
  810.     gnustepdir=`echo "$GNUSTEP_LOCAL_ROOT" | sed -e "s|^${prefix}|prefix|"`
  811.     gnustepdir=`echo $gnustepdir | sed -e 's|^prefix|${prefix}|'`
  812.     fi
  813.  
  814.     with_appspath=$gnustepdir/Apps
  815. fi
  816.  
  817. wprefsdir=$with_appspath/WPrefs.app
  818.  
  819. AC_SUBST(wprefsdir)
  820.  
  821.  
  822.  
  823. dnl Enable single appicon per wm instance+class combo -cls
  824. dnl =====================================================
  825. AC_ARG_ENABLE(single-icon,
  826. [  --enable-single-icon    create one application icon per WM_INSTANCE+WM_CLASS],
  827. if test "$enableval" = yes; then
  828.     AC_DEFINE(REDUCE_APPICONS)
  829. fi
  830. )
  831.  
  832. dnl Enable User Defined Menu thing
  833. dnl ==================================
  834. AC_ARG_ENABLE(usermenu,
  835. [  --enable-usermenu       user defined menus for applications
  836. ],
  837. if test "$enableval" = yes; then
  838.     AC_DEFINE(USER_MENU)
  839. fi
  840. )
  841.  
  842.  
  843. dnl
  844. dnl Nicolai:  Program tests for Documentation Section
  845. dnl =================================================
  846. dnl DOCTYPES=""
  847. dnl AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ,$PATH)
  848. dnl if test "x$MAKEINFO" != "x" ; then
  849. dnl       DOCTYPES="$DOCTYPES info_doc"
  850. dnl fi
  851. dnl AC_CHECK_PROG(TEX, tex, tex, ,$PATH)
  852. dnl if test "x$TEX" != "x" ; then
  853. dnl       DOCTYPES="$DOCTYPES dvi_doc"
  854. dnl fi
  855. dnl AC_CHECK_PROG(DVIPS, dvips, dvips, ,$PATH)
  856. dnl if test "x$DVIPS" != "x" ; then
  857. dnl       DOCTYPES="$DOCTYPES ps_doc"
  858. dnl fi
  859. dnl AC_CHECK_PROG(PERL, perl, perl, ,$PATH)
  860. dnl if test "x$PERL" != "x" ; then
  861. dnl       DOCTYPES="$DOCTYPES html_doc"
  862. dnl fi
  863. dnl AC_PATH_PROG(PERL_PATH, perl, perl, ,$PATH)
  864. dnl AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html, ,$PATH)
  865.   
  866. dnl AC_SUBST(DOCTYPES)
  867.  
  868. AC_OUTPUT(Makefile po/Makefile util/Makefile test/Makefile wmlib/Makefile \
  869.     WINGs/Makefile WINGs/Resources/Makefile src/Makefile src/wconfig.h \
  870.     wrlib/Makefile doc/Makefile WindowMaker/Makefile contrib/Makefile \
  871.     WindowMaker/Backgrounds/Makefile WindowMaker/Defaults/Makefile \
  872.     WindowMaker/IconSets/Makefile WindowMaker/Icons/Makefile \
  873.     WindowMaker/Pixmaps/Makefile WindowMaker/Styles/Makefile \
  874.     WindowMaker/Themes/Makefile \
  875.     WPrefs.app/Makefile WPrefs.app/tiff/Makefile WPrefs.app/xpm/Makefile \
  876.     WPrefs.app/po/Makefile contrib/WindowMaker.spec )
  877.  
  878.  
  879.  
  880. dnl
  881. dnl Output some helpful data for compiling wraster and WINGs/WUtil apps
  882. dnl ===================================================================
  883. dnl
  884.  
  885. dnl echo "WFLAGS=\"$LIBPL_INC_PATH -I$prefix/include\"" > WINGs-flags
  886. dnl echo "WLIBS=\"-L$exec_prefix/lib -lWINGs -lwraster $LIBPL_LIBS $GFXLIBS -lm\""\
  887. dnl     | sed -e 's|\$(prefix)|'"$prefix|" >> WINGs-flags
  888.  
  889. dnl The #lp# and #rp# stuff below is a hack because [ and ] get lost when
  890. dnl parsed by m4
  891.  
  892. cat <<EOF >get-wraster-flags
  893. #!/bin/sh
  894.  
  895. prefix="$prefix"
  896. exec_prefix=\$prefix
  897.  
  898. WCFLAGS="-I\$prefix/include $inc_search_path"
  899. WLFLAGS="-L\$exec_prefix/lib $lib_search_path"
  900. WLIBS="-lwraster $GFXLIBS $XLIBS -lm"
  901.  
  902. usage="Usage: get-wraster-flags #lp#--cflags#rp# #lp#--ldflags#rp# #lp#--libs#rp#"
  903.  
  904. if test \$# -eq 0; then
  905.       echo "\${usage}" 1>&2
  906.       exit 1
  907. fi
  908.  
  909. while test \$# -gt 0; do
  910.   case \$1 in
  911.     --cflags)
  912.     echo \$WCFLAGS
  913.         ;;
  914.     --ldflags|--lflags)
  915.     echo \$WLFLAGS
  916.         ;;
  917.     --libs)
  918.     echo \$WLIBS
  919.         ;;
  920.     *)
  921.         echo "\${usage}" 1>&2
  922.         exit 1
  923.           ;;
  924.   esac
  925.   shift
  926. done
  927.  
  928.  
  929. EOF
  930.  
  931. cat <<EOF >get-wings-flags
  932. #!/bin/sh
  933.  
  934. prefix="$prefix"
  935. exec_prefix=\$prefix
  936.  
  937. WCFLAGS="-I\$prefix/include $inc_search_path"
  938. WLFLAGS="-L\$exec_prefix/lib $lib_search_path"
  939. WLIBS="-lWINGs -lwraster $GFXLIBS $XLIBS -lm $NETLIBS -lPropList"
  940.  
  941. usage="Usage: get-wings-flags #lp#--cflags#rp# #lp#--ldflags#rp# #lp#--libs#rp#"
  942.  
  943. if test \$# -eq 0; then
  944.       echo "\${usage}" 1>&2
  945.       exit 1
  946. fi
  947.  
  948. while test \$# -gt 0; do
  949.   case \$1 in
  950.     --cflags)
  951.     echo \$WCFLAGS
  952.         ;;
  953.     --ldflags|--lflags)
  954.     echo \$WLFLAGS
  955.         ;;
  956.     --libs)
  957.     echo \$WLIBS
  958.         ;;
  959.     *)
  960.         echo "\${usage}" 1>&2
  961.         exit 1
  962.           ;;
  963.   esac
  964.   shift
  965. done
  966.  
  967.  
  968. EOF
  969.  
  970. cat <<EOF >get-wutil-flags
  971. #!/bin/sh
  972.  
  973. prefix="$prefix"
  974. exec_prefix=\$prefix
  975.  
  976. WCFLAGS="-I\$prefix/include $inc_search_path"
  977. WLFLAGS="-L\$exec_prefix/lib $lib_search_path"
  978. WLIBS="-lWUtil $NETLIBS -lPropList"
  979.  
  980. usage="Usage: get-wutil-flags #lp#--cflags#rp# #lp#--ldflags#rp# #lp#--libs#rp#"
  981.  
  982. if test \$# -eq 0; then
  983.       echo "\${usage}" 1>&2
  984.       exit 1
  985. fi
  986.  
  987. while test \$# -gt 0; do
  988.   case \$1 in
  989.     --cflags)
  990.     echo \$WCFLAGS
  991.         ;;
  992.     --ldflags|--lflags)
  993.     echo \$WLFLAGS
  994.         ;;
  995.     --libs)
  996.     echo \$WLIBS
  997.         ;;
  998.     *)
  999.         echo "\${usage}" 1>&2
  1000.         exit 1
  1001.           ;;
  1002.   esac
  1003.   shift
  1004. done
  1005.  
  1006.  
  1007. EOF
  1008.  
  1009. sed 's/#lp#/[/g' get-wraster-flags | sed 's/#rp#/]/g' > wrlib/get-wraster-flags
  1010. sed 's/#lp#/[/g' get-wings-flags | sed 's/#rp#/]/g' > WINGs/get-wings-flags
  1011. sed 's/#lp#/[/g' get-wutil-flags | sed 's/#rp#/]/g' > WINGs/get-wutil-flags
  1012.  
  1013. chmod 755 wrlib/get-wraster-flags WINGs/get-wings-flags WINGs/get-wutil-flags
  1014.  
  1015. rm -f get-wraster-flags get-wings-flags get-wutil-flags
  1016.  
  1017.  
  1018. dnl
  1019. dnl Spit out the configuration
  1020. dnl ==========================
  1021.  
  1022. supported_gfx="$supported_gfx builtin-PPM"
  1023.  
  1024. if test "x$MOFILES" = "x"; then
  1025.     mof=none
  1026. else
  1027.     mof=$MOFILES
  1028. fi
  1029.  
  1030.  
  1031. echo
  1032. echo "Window Maker was configured as follows:"
  1033. echo
  1034. echo "Installation path prefix: $prefix"
  1035. echo "Installation path prefix for binaries: $_bindir"
  1036. echo "Installation path for WPrefs.app: $wprefsdir" | sed -e 's|\$(prefix)|'"$prefix|"
  1037. echo "Graphic format libraries: $supported_gfx"
  1038. echo "Sound support: $sound"
  1039. echo "Translated message files to install: $mof"
  1040. if test "x$MOFILES" != "x"; then
  1041.     echo "Installation path of translated messages: $NLSDIR" | sed -e 's|\$(prefix)|'"$prefix|"
  1042. fi
  1043.  
  1044. dnl WM_PRINT_REDCRAP_BUG_STATUS
  1045.  
  1046. if test "x$ac_cv_header_jpeglib_h" != xyes; then
  1047. echo "WARNING   WARNING   WARNING   WARNING   WARNING   WARNING   WARNING"
  1048. echo
  1049. echo "JPEG support will not be included because the JPEG library is"
  1050. echo "not installed correctly or was not found. Background images"
  1051. echo "from themes will not display as they usually are JPEG files."
  1052. echo
  1053. echo "To fix, download and install the jpeg library and/or make sure you"
  1054. echo "installed all jpeg related packages, SPECIALLY the development packages"
  1055. echo "like jpeg-devel (if you use some prepackaged version of libjpeg)."
  1056. echo
  1057. echo "WARNING   WARNING   WARNING   WARNING   WARNING   WARNING   WARNING"
  1058. fi
  1059.  
  1060.  
  1061. dnl This is for Emacs.  I'm lazy, I know... (nicolai)
  1062. dnl ================================================
  1063. dnl Local Variables:
  1064. dnl compile-command: "autoconf"
  1065. dnl End:
  1066.  
  1067.